<template>
  <div class="user">
    <el-tree
      class="el-tree-1"
      ref="orgTree"
      node-key="id"
      :data="orgList"
      :props="defaultProps"
      @node-click="handleNodeClick"
    ></el-tree>
    <div class="userList">
      <div class="list-div">
        <el-row>
          <el-col :lg="4" :md="6">
            <el-button type="success" size="small" plain @click="handleSave()">新 增</el-button>
            <el-button type="danger" size="small" plain @click="deleteBatch()">删 除</el-button>
          </el-col>
          <el-col :lg="10" :md="12">
            <el-col :lg="10" :md="10">
              <el-input
                size="small"
                @keyup.enter.native="search"
                placeholder="登录账号/姓名/手机号/所属部门/EMAIL"
                v-model="searchFilter.condition"
                clearable
              ></el-input>
            </el-col>
            <el-col :offset="1" :span="2">
              <el-button size="small" type="primary" @click="search" plain>查 询</el-button>
            </el-col>
          </el-col>
        </el-row>

        <br>
        <el-table
          :data="tableData"
          border
          style="width: 100%"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="40" header-align="center"></el-table-column>
          <el-table-column type="index" width="40" header-align="center"></el-table-column>
          <el-table-column type="expand" width="40" header-align="center">
            <template slot-scope="scope">
              <el-form label-position="left" inline class="demo-table-expand">
                <el-form-item label="办公室">
                  <span>{{ scope.row.office }}</span>
                </el-form-item>
                <el-form-item label="工位">
                  <span>{{ scope.row.station }}</span>
                </el-form-item>
                <el-form-item label="EMAIL">
                  <span>{{ scope.row.email }}</span>
                </el-form-item>
                <el-form-item label="入职时间">
                  <span>{{ scope.row.hireDate }}</span>
                </el-form-item>
                <el-form-item label="地址">
                  <span>{{ scope.row.address }}</span>
                </el-form-item>
                <el-form-item label="出生日期">
                  <span>{{ scope.row.birthday }}</span>
                </el-form-item>
                <el-form-item label="创建时间">
                  <span>{{ scope.row.createTime }}</span>
                </el-form-item>
                <el-form-item label="更新时间">
                  <span>{{ scope.row.updateTime }}</span>
                </el-form-item>
              </el-form>
            </template>
          </el-table-column>
          <el-table-column sortable prop="account" label="登录名称" align="center" width="150"></el-table-column>
          <el-table-column sortable prop="userName" align="center" label="姓名"></el-table-column>
          <el-table-column sortable prop="phone" align="center" label="手机号"></el-table-column>
          <el-table-column sortable prop="orgName" align="center" label="所属部门"></el-table-column>
          <el-table-column sortable prop="jobNo" align="center" label="工号"></el-table-column>
          <el-table-column sortable prop="positionName" align="center" label="职位"></el-table-column>
          <el-table-column sortable prop="status" align="center" label="状态">
            <template slot-scope="scope">
              <el-switch
                v-model="scope.row.status"
                active-value="1"
                inactive-value="2"
                active-color="#13ce66"
                inactive-color="#C0C0C0"
                @change="changeStatus(scope.row)"
              ></el-switch>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" align="center">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click.native="handleSetRole(scope.row)">角色</el-button>
              <el-button type="text" size="small" @click.native="handleSetPas(scope.row)">重置密码</el-button>
              <el-button type="text" size="small" @click.native="handleSetOrg(scope.row)">部门</el-button>
              <el-button type="text" size="small" @click.native="handleSetPosition(scope.row)">职位</el-button>
              <el-button type="text" size="small" @click.native="handleEdit(scope.row)">编辑</el-button>
            </template>
          </el-table-column>
        </el-table>
        <div class="pagination block">
          <el-pagination
            background
            @current-change="handleCurrentChange"
            :current-page.sync="page"
            :page-size="pageSize"
            layout="total, prev, pager, next"
            :total="total"
          ></el-pagination>
        </div>
      </div>
    </div>
    <div class="saveModal">
      <el-dialog :title="saveName" :visible.sync="showSaveModal" @close="cancelR">
        <el-form
          :rules="saveModalRules"
          ref="saveModal"
          :model="saveModal"
          label-width="120px"
          size="small"
        >
          <div class="face-div">
            <el-tooltip class="item" effect="dark" content="点击上传头像" placement="right">
              <el-upload
                class="avatar-uploader"
                action="/api/file/upload"
                :show-file-list="false"
                :on-success="handleAvatarSuccess"
                :before-upload="beforeAvatarUpload"
                :data="faceUploadData"
              >
                <img
                  v-if="saveModal.avatarUrl!=null&&saveModal.avatarUrl!=''"
                  :src="src"
                >
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-tooltip>
          </div>
          <br>
          <el-row>
            <el-col :span="12">
              <el-form-item label="登录账号" prop="account">
                <el-input v-model="saveModal.account"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="密码">
                <el-input
                  type="password"
                  minlength="6"
                  maxlength="20"
                  placeholder="不填则为默认密码:123456"
                  v-model="saveModal.password"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="姓名" prop="userName">
                <el-input v-model="saveModal.userName"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="手机号" prop="phone">
                <el-input v-model="saveModal.phone"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="邮箱" prop="email">
                <el-input v-model="saveModal.email"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证" prop="idNo">
                <el-input v-model="saveModal.idNo"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="座机号">
                <el-input v-model="saveModal.telephone"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="办公室">
                <el-input v-model="saveModal.office"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="工位">
                <el-input v-model="saveModal.station"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="地址">
                <el-input v-model="saveModal.address"></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="生日">
                <el-col>
                  <el-date-picker
                    type="date"
                    format="yyyy-MM-dd"
                    value-format="yyyy-MM-dd"
                    placeholder="选择日期"
                    v-model="saveModal.birthday"
                    style="width: 100%;"
                  ></el-date-picker>
                </el-col>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="性别">
                <el-radio-group v-model="saveModal.sex" size="medium">
                  <el-radio border :label="0">男</el-radio>
                  <el-radio border :label="1">女</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="入职日期">
                <el-date-picker
                  type="date"
                  format="yyyy-MM-dd"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                  v-model="saveModal.hireDate"
                  style="width: 100%;"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="工号" prop="jobNo">
                <el-input v-model="saveModal.jobNo"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <br>
          <br>
          <el-row>
            <el-col :offset="6" :span="6">
              <el-form-item size="large">
                <el-button type="primary" @click="save('saveModal')">{{saveBtnName}}</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-dialog>
    </div>
    <div class="setRoleModal">
      <el-dialog title :visible.sync="showSetRoleModal">
        <el-row>
          <el-col>设置角色</el-col>
        </el-row>
        <br>
        <el-row>
          <el-col>
            <el-checkbox
              :indeterminate="isIndeterminate"
              v-model="checkRoleAll"
              @change="handleCheckRoleAllChange"
            >全选</el-checkbox>
            <div style="margin: 15px 0;"></div>
            <el-checkbox-group v-model="checkRoleList" @change="handleCheckedRoleChange">
              <el-checkbox v-for="role in roleList" :label="role.id" :key="role.id">{{role.name}}</el-checkbox>
              <br>
            </el-checkbox-group>
          </el-col>
        </el-row>
        <br>
        <el-row>
          <el-col :offset="11">
            <el-button type="primary" size="small" @click="setRole">保 存</el-button>
          </el-col>
        </el-row>
      </el-dialog>
    </div>

    <div class="setOrgModal">
      <el-dialog title :visible.sync="showSetOrgModal">
        <el-row>
          <el-col>设置部门</el-col>
        </el-row>
        <br>
        <el-row>
          <el-col>
            <el-tree ref="setOrgTree" node-key="id" :data="orgList" :props="defaultProps"></el-tree>
          </el-col>
        </el-row>
        <br>

        <el-row>
          <el-col :offset="11">
            <el-button type="primary" size="small" @click="setOrg">保 存</el-button>
          </el-col>
        </el-row>
      </el-dialog>

      <div class="setPositionModal">
        <el-dialog title :visible.sync="showSetPositionModal">
          <el-row>
            <el-col>设置职位</el-col>
          </el-row>
          <br>
          <el-row>
            <el-col :md="12">
              <el-tree
                ref="setOrgTree"
                node-key="id"
                :data="orgList"
                :props="defaultProps"
                @node-click="handleNodeOrgClick"
              ></el-tree>
            </el-col>
            <el-col :md="12">
              <el-table
                ref="tableBodePersonPositionData"
                :data="tableBodePersonPositionData"
                tooltip-effect="dark"
                style="width: 100%"
                class="person-position"
              >
                <el-table-column width="55">
                  <template slot-scope="scope">
                    <el-radio class="radio" v-model="addPersonForm.value" :label="scope.row.id"></el-radio>
                  </template>
                </el-table-column>
                <el-table-column prop="name" label="人员名称" align="center"></el-table-column>
              </el-table>
            </el-col>
          </el-row>
          <br>
          <el-row>
            <el-col :offset="11">
              <el-button type="primary" size="small" @click="setPosition">保 存</el-button>
            </el-col>
          </el-row>
        </el-dialog>
      </div>
    </div>
  </div>
</template>

<script>
  import Axios from "axios"
export default {
  name: "User",
  data() {
    //手机号校验
    var checkPhone = (rule, value, callback) => {
      if (!/^1[34578]\d{9}$/.test(value)) {
        return callback(new Error("请输入正确的手机号"));
      } else {
        return callback();
      }
    };
    //邮箱校验
    var checkEmail = (rule, value, callback) => {
      if (
        !/^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(value)
      ) {
        return callback(new Error("请输入正确的邮箱"));
      } else {
        return callback();
      }
    };
    //身份证校验
    var checkIdNo = (rule, value, callback) => {
      if (
        !/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
          value
        )
      ) {
        return callback(new Error("请输入正确的身份证"));
      } else {
        return callback();
      }
    };
    return {
      src:"",
      saveName: "",
      setRoleUserId: "",
      setOrgUserId: "",
      checkRoleAll: false,
      checkRoleList: [],
      roleList: [],
      tableBodePersonPositionData: [],
      isIndeterminate: true,
      showSetRoleModal: false,
      showSetOrgModal: false,
      showSetPositionModal: false,
      searchFilter: {
        condition: ""
      },
      saveBtnName: "创建账号",
      showSaveModal: false,
      orgList: [
        {
          id: "",
          name: "组织架构",
          items: []
        }
      ],
      tableData: [],
      page: 1,
      pageSize: 10,
      total: 100,
      orgId: null,
      multipleSelection: [],
      saveModalRules: {
        account: [
          {
            required: true,
            message: "请输入登录账号",
            trigger: "blur"
          }
        ],
        userName: [
          {
            required: true,
            message: "请输入姓名",
            trigger: "blur"
          }
        ],
        phone: [
          {
            required: true,
            message: "请输入正确的手机号",
            trigger: "blur"
          },
          {
            validator: checkPhone,
            trigger: "blur"
          }
        ],
        email: [
          {
            required: true,
            message: "请输入邮箱",
            trigger: "blur"
          },
          {
            validator: checkEmail,
            trigger: "blur"
          }
        ],
        jobNo: [
          {
            required: true,
            message: "请输入工号",
            trigger: "blur"
          }
        ]
      },
      saveModal: {
        id: "",
        userName: "", //姓名
        password: "", //密码
        account: "", //登陆账号
        phone: "", //手机号
        email: "", //邮箱
        sex: 0, //性别
        avatarUrl: "", //头像链接
        idNo: "", //身份证
        telephone: "", //座机号
        office: "", //办公室
        station: "", //工位
        address: "", //地址
        birthday: "", //生日
        orgId: "", //归属组织ID
        hireDate: "", // 入职日期
        jobNo: "" ,// 工号
        faceId:""//头像Id
      },
      faceUploadData: {
        type: "face",
        folder: "user/face"
      },
      defaultProps: {
        children: "items",
        label: "name"
      },
      addPersonForm: {
        value: ""
      }
    };
  },
  mounted() {
    this.getOrgList();
    this.handleNodeClick();
  },
  methods: {
    openSaveModal() {
      this.saveModal = {
        id: "",
        userName: "", //姓名
        password: "", //密码
        account: "", //登陆账号
        phone: "", //手机号
        email: "", //邮箱
        sex: 0, //性别
        avatarUrl: "", //头像链接
        idNo: "", //身份证
        telephone: "", //座机号
        office: "", //办公室
        station: "", //工位
        address: "", //地址
        birthday: "", //生日
        orgId: "", //归属组织ID
        hireDate: "", // 入职日期
        jobNo: "" // 工号
      };
    },
    //关闭弹框右上角
    cancelR() {
      this.$refs.saveModal.clearValidate();
    },
    setOrg() {
      let _this = this;
      let orgId = this.$refs.setOrgTree.getCurrentKey();
      if (orgId == null || orgId == "") {
        this.$message.warning("请选择一项有效数据");
        return;
      }
      this.http
        .post("/api/user/setUserOrg", {
          id: this.setOrgUserId,
          orgId: orgId
        })
        .then(res => {
          var data = res.data;
          if (data.code === 200) {
            this.showSetOrgModal = false;
            _this.handleNodeClick();
            this.$message.success(data.msg);
          } else {
            this.$message.error(data.msg);
          }
        });
    },
    setRole() {
      let checkList = this.checkRoleList;
      let roleIdListStr = checkList.join(",");
      this.http
        .post("/api/user/setUserRole", {
          id: this.setRoleUserId,
          roleIdList: roleIdListStr
        })
        .then(res => {
          var data = res.data;
          if (data.code === 200) {
            this.showSetRoleModal = false;
            this.$message.success(data.msg);
          } else {
            this.$message.error(data.msg);
          }
        });
    },
    //设置职位事件
    handleSetPosition(row) {
      console.log(row);
      this.showSetPositionModal = true;
      this.setRoleUserId = row.id;
    },
    setPosition() {
      this.http
        .post("/api/user/serUserPosition", {
          userId: this.setRoleUserId,
          positionId: this.addPersonForm.value
        })
        .then(res => {
          console.log(res);
          if (res.data.code === 200) {
            this.$message.success(res.data.msg);
            this.showSetPositionModal = false;
            this.handleNodeClick();
          }
        });
      this.http
        .post("/api/user/getUserList", {
          orgId: this.orgId,
          current: this.page,
          size: this.pageSize,
          descs: "create_time"
        })
        .then(res => {
          var data = res.data;
          console.log("用户列表：");
          console.log(data);
          // console.log(data)
          if (data.code === 200) {
            this.tableData = data.data.records;
            this.total = data.data.total;
          } else {
            this.$message.error(data.msg);
          }
        });
    },
    // 点击部门触发事件
    handleNodeOrgClick(data) {
      console.log(data);
      this.http
        .post("/api/position/query", {
          Q_COLUMN: "AND_org_id_EQ",
          Q_VALUE: data.id
        })
        .then(res => {
          console.log(res);
          let data = res.data.rows;
          this.tableBodePersonPositionData = data;
        });
    },
    //设置角色事件
    handleSetRole(row) {
      this.checkRoleList = [];
      let _this = this;
      this.setRoleUserId = row.id;
      this.http
        .post("/api/role/query", {
          P_NO: 1,
          P_SIZE: 99
        })
        .then(res => {
          var data = res.data;
          this.roleList = data.rows;
        });
      this.http
        .post("/api/user/getUserRoleId", {
          userId: row.id
        })
        .then(res => {
          var data = res.data;
          if (data.code === 200) {
            for (var i = 0; i < data.data.length; i++) {
              _this.checkRoleList.push(data.data[i].roleId);
            }
            this.showSetRoleModal = true;
          } else {
            this.$message.error(data.msg);
          }
        });
    },
    //设置部门事件
    handleSetOrg(row) {
      this.showSetOrgModal = true;
      this.setOrgUserId = row.id;
    },
    handleSetPas(row) {
      this.$confirm("此操作将重置密码, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.http.post("/api/user/resetPwd", { id: row.id }).then(res => {
            this.$message.success(res.data.msg);
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消重置密码"
          });
        });
    },
    handleCheckRoleAllChange(val) {
      let arr = [];
      for (let i = 0; i < this.roleList.length; i++) {
        arr.push(this.roleList[i].id);
      }
      this.checkRoleList = val ? arr : [];
      this.isIndeterminate = false;
    },
    handleCheckedRoleChange(value) {
      let checkedCount = value.length;
      console.log(value);
      this.checkRoleAll = checkedCount === this.roleList.length;
      this.isIndeterminate =
        checkedCount > 0 && checkedCount < this.roleList.length;
    },
    //根据条件查询列表
    search() {
      this.http
        .post("/api/user/getUserList", {
          orgId: this.orgId,
          current: this.page,
          size: this.pageSize,
          search: true,
          searchValue: this.searchFilter.condition,
          descs: "create_time"
        })
        .then(res => {
          var data = res.data;
          if (data.code === 200) {
            this.tableData = data.data.records;
            this.total = data.data.total;
          } else {
            this.$message.error(data.msg);
          }
        });
    },
    //新增事件
    handleSave() {
      let orgId = this.$refs.orgTree.getCurrentKey();
      if (orgId == null || orgId == "") {
        this.$message.warning(
          "未选择左侧指定归属部门,所新增的数据默认归属根部门"
        );
      }
      this.saveBtnName = "创建账号";
      this.openSaveModal();
      this.saveName = "新建用户信息";
      this.showSaveModal = true;
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    handleAvatarSuccess(res, file) {
      if (res.code === 200) {
        this.saveModal.avatarUrl = res.data.url;
        this.saveModal.faceId=res.data.id;
        this.getVerification ();
        console.log(this.saveModal.avatarUrl);
      } else {
        this.$message.error(res.msg);
      }
    },
    beforeAvatarUpload(file) {
      const isLt2M = file.size / 1024 / 1024 < 2;

      if (!isLt2M) {
        this.$message.error("上传头像图片大小不能超过 2MB!");
      }
      return isLt2M;
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleCurrentChange(val) {
      this.page = val;
      this.handleNodeClick();
    },
    getVerification () {
      Axios.get(this.saveModal.avatarUrl,{
        headers: {
          'Authorization': window.localStorage.token
        }, responseType: 'arraybuffer'})
          .then(res => {
            console.log(res.data)
            return 'data:image/png;base64,' + btoa(
              new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), '')
            )
          }).then(data => {
            console.log(data);
          this.src=data;
        })
    },
    handleEdit(row) {
      this.saveModal = row;
      console.log(row);
      this.getVerification();
      console.log(this.saveModal.avatarUrl);
      this.saveName = "编辑用户信息";
      this.showSaveModal = true;
      console.log(this.saveModal);
      this.saveBtnName = "保存账号";
    },
    save(formName) {
      let _this = this;
      this.$refs[formName].validate(valid => {
        if (valid == undefined) {
          console.log("error submit!!");
          return false;
        }
        if (!valid) {
          console.log("error submit!!");
          return false;
        } else {
          this.saveModal.orgId = this.orgId;
          let a=this.saveModal.avatarUrl;
          this.saveModal.avatarUrl=a.split("=")[1];
          console.log(this.saveModal.avatarUrl);
          console.log(window.localStorage.token);
          this.http.post("/api/user/saveInfo", this.saveModal).then(res => {
            let data = res.data;
            if (data.code === 200) {
              this.$message({
                showClose: true,
                message: data.msg,
                type: "success"
              });
              _this.showSaveModal = false;
              _this.handleNodeClick();
            } else {
              this.$message.error(data.msg);
            }
          });
        }
      });
    },
    //批量删除
    deleteBatch() {
      let selectDataList = this.multipleSelection;
      if (selectDataList.length == 0) {
        this.$message({
          message: "请选中一条项再操作",
          type: "warning"
        });
        return;
      }
      let ids = "";
      for (let i = 0; i < selectDataList.length; i++) {
        if (i != selectDataList.length - 1) {
          ids += selectDataList[i].id + ",";
        } else {
          ids += selectDataList[i].id;
        }
      }
      this.$confirm("此操作将永久删除选中的数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.http
          .post("/api/user/deleteBatchIds", {
            ids: ids
          })
          .then(res => {
            let data = res.data;

            if (data.code === 200) {
              this.$message({
                showClose: true,
                message: data.msg,
                type: "success"
              });
              this.handleNodeClick();
            } else {
              this.$message.error(data.msg);
            }
          });
      });
    },
    changeStatus(row) {
      this.http
        .post("/api/user/save", {
          id: row.id,
          status: row.status
        })
        .then(res => {
          let data = res.data;
          if (data.code === 200) {
            this.$message({
              showClose: true,
              message: data.msg,
              type: "success"
            });
          }
        });
    },
    getOrgList() {
      var _this = this;
      this.http
        .post("/api/org/orgNodeList", {
          type: "org"
        })
        .then(res => {
          let data = res.data.data;
          _this.orgList[0].items = data;
          console.log(data);
        })
        .catch(err => {});
    },
    handleNodeClick(data) {
      if (data != null) {
        this.orgId = data.id;
      }
      this.http
        .post("/api/user/getUserList", {
          orgId: this.orgId,
          current: this.page,
          size: this.pageSize,
          descs: "create_time",

        })
        .then(res => {
          var data = res.data;
          console.log("用户列表：");
          console.log(data);
          // console.log(data)
          if (data.code === 200) {
            this.tableData = data.data.records;
            this.total = data.data.total;
          } else {
            this.$message.error(data.msg);
          }
        });
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
.demo-table-expand {
  font-size: 0;
}

.demo-table-expand label {
  width: 90px;
  color: #99a9bf;
}

.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 50%;
}

.face-div {
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  text-align: center;

  .item {
    display: inline-block;
    box-shadow: 0 0 4px black;
  }

  img {
    width: 200px;
    height: auto;
  }
}

.user {
  height: 100%;
  // .el-radio__label {
  //   display: none !important;
  // }
  .pagination {
    float: right;
  }
  .el-tree-1 {
    float: left;
    padding: 0px 10px;
    width: 15%;
    height: 100%;
    border-right: 1px solid #ccc;
    box-sizing: border-box;
  }

  .userList {
    float: left;
    width: 85%;
    padding: 0 10px;
    box-sizing: border-box;
  }
}

// .el-radio__label {
//   display: none !important;
// }

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}

.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}

.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
.person-position {
  .el-radio__label {
    display: none !important;
  }
}
</style>
